import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.folio.dbschema.ObjectMapperTool;
import org.folio.rest.jaxrs.model.BookInStorage;
import org.folio.rest.jaxrs.resource.BookInStorages;

import java.io.BufferedInputStream;
import java.util.Date;

public class Test {
  public static void main(String[] args) {
    buildDemoJson();
  }
  public static void buildDemoJson(){
    BookInStorage bookInStorage = new BookInStorage();
    bookInStorage.setInDate(new Date());
    bookInStorage.setBookseller("浙江新华");
    bookInStorage.setBeginBarcode("A2300001");
    bookInStorage.setEndBarcode("A2302709");
    bookInStorage.setTotality(1929);
    bookInStorage.setYearFunding("2021");
    bookInStorage.setStorage("新书区");
    bookInStorage.setColourCode("褐");
    bookInStorage.setStatus(BookInStorage.Status.EDITING);

    ObjectMapper mapper = ObjectMapperTool.getMapper();

    try {
      System.out.println(mapper.writeValueAsString(bookInStorage));
    } catch (JsonProcessingException e) {
      e.printStackTrace();
    }

  }
}
